<template>
	<view>
		<wrap-version-update :apiUrl="apiUrl" @finish="handlerFinish" :auto="true" ref="updateRef" @check="handlerCheck"
			@error="handlerError" id="372917185699909"></wrap-version-update>
	</view>
</template>

<script>
	import global from '../common/global.js'
	export default {
		name: "update",
		data() {
			return {
				apiUrl: null,
				version: '3.1.0', //当前版本号
			};
		},
		created() {
			this.apiUrl = global.api + "/systemVersion/getCurrentVersion?role=2&version=" + this.version
		},
		methods: {
			handlerFinish() {
				// uni.showToast({
				// 	icon: 'none',
				// 	title: '已经是最新版本'
				// })
				console.log('已经是最新版本')
			},
			handlerCheck(e) {
				console.log(e)
				// if(e.needUpdate){
				// 	//如果需要更新就隐藏tabbar
				// 	uni.hideTabBar()
				// }
			},
			handlerError(e) {
				console.log(e)
			},
		}
	}
</script>

<style>

</style>